package kz.kstu.shop.business.server.impl;

import kz.kstu.shop.business.entity.CommonEntityConstant;
import kz.kstu.shop.business.entity.Synchronizable;
import kz.kstu.shop.business.entity.guide.Product;
import kz.kstu.shop.business.server.api.GuideService;

import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.persistence.Table;
import java.util.Arrays;
import java.util.List;

/**
 * @author Filipp_Stankevich
 *         created: 26.07.11 19:34
 */
public class GuideServiceImpl extends AbstractService implements GuideService {

    public List<Product> findAllProducts() {
        EntityManager entityManager = getEntityManager();
        Query query = entityManager.createNamedQuery(CommonEntityConstant.FIND_ALL_PRODUCTS);
        return (List<Product>) query.getResultList();
    }
}
